package mrusanov.ai

import mrusanov.tournament.MatchInfo
import mrusanov.battle.Battle

class AIBattlePlayer {
	private[this] val ai = new StupidBattleAI

	def playBattle(game: MatchInfo) {
		val battle = new Battle(game.host, game.guest)

		while (!battle.isOver) {
			ai.makeTurn(battle, game.host)
			ai.makeTurn(battle, game.guest)
		}

		game.hostPoints = battle.hostPoints
		game.guestPoints = battle.guestPoints
		game.setOver()
	}
}
